package ace.module.oauth2.server.core.impl.manager;

import ace.cmp.data.spring.data.jdbc.querydsl.rsql.core.manager.DtoManager;
import ace.module.oauth2.server.api.model.dto.Oauth2RegisteredClientAuthConfigDto;
import ace.module.oauth2.server.core.impl.dao.entity.Oauth2RegisteredClientAuthConfig;
import java.util.List;

/**
 * oauth2客户端支持的授权协议配置,支持本地bean与rest授权方式 spring data jdbc querydsl rsql manager.
 *
 * @author Caspar
 */
public interface Oauth2RegisteredClientAuthConfigManager extends DtoManager<Oauth2RegisteredClientAuthConfig, Long, Oauth2RegisteredClientAuthConfigDto> {


  List<Oauth2RegisteredClientAuthConfig> getByIdOfClientAndDeleteFlagIsFalseFormDbOrCache(String idOfClient);

  List<Oauth2RegisteredClientAuthConfig> getByIdOfClientAndStatusIsEnableAndDeleteFlagIsFalseFormDbOrCache(String idOfClient);

  List<Oauth2RegisteredClientAuthConfig> getByAuthTypeFromMemory(List<Oauth2RegisteredClientAuthConfig> allOauth2RegisteredClientAuthConfigs, String authType);

  List<Oauth2RegisteredClientAuthConfig> getByIdOfClientAndStatusIsEnableAndBizAuthTypeIsAuthorizationTypeFromDbOrCache(String idOfClient);

  List<Oauth2RegisteredClientAuthConfig> getByIdOfClientAndStatusIsEnableAndBizAuthTypeIsAuthenticationTypeFromDbOrCache(String idOfClient);

  boolean isEnableStatus(Oauth2RegisteredClientAuthConfig oauth2RegisteredClientAuthConfig);

  boolean isAuthorizationType(Oauth2RegisteredClientAuthConfig oauth2RegisteredClientAuthConfig);

  boolean isAuthenticationType(Oauth2RegisteredClientAuthConfig oauth2RegisteredClientAuthConfig);
}